<!--   
Persistent Digital Archives and Library System (PeDALS) 
(c) 2008 - All Rights Reserved
//-->
<?php 
//submit form validation
if (isset($_POST['CreateSeries'])){	
	$submitFrom = 0;
//provenance
if (empty($_POST['selectprov'])){
	$messageProvenance = "<span style=\"padding-left:20px; position:absolute; float:right; color:red;\">Please select a Provenance</span>";
	$submitFrom = 1;	
	}
//title	
if (empty($_POST['SeriesTitle'])) {
	$messageSeries = "<span style=\"padding-left:20px; position:absolute; float:right; color:red;\">Please enter a series title</span>";
	$submitFrom = 1;
	}	
//open date			
  	if (!empty($_POST['SeriesOpenDate'])) {
		if (!ereg ("([0-3]{1})([0-9]{1})/([0-9]{1,2})/([0-3]{1})([0-9]{3})",$_POST['SeriesOpenDate'])) {		   
		   $messageOpenDate = "<span style=\"padding-left:20px; position:absolute; float:right; color:red;\">Please enter a valid date. (eg. mm/dd/yyyy)</span>";
		   $submitFrom = 1;
		}		
	}
//start date		
  	if (!empty($_POST['SeriesStartYear'])) {
		if (!ereg("([0-9]{4})",$_POST['SeriesStartYear']) || strlen($_POST['SeriesStartYear'])!==4) {	   
			$messageStartDate = "<span style=\"padding-left:20px; position:absolute; float:right; color:red;\">Please enter a valid year. (eg. yyyy)</span>";
			$submitFrom = 1;
			}
			else{
				if ($_POST['SeriesStartYear'] < 2100 && $_POST['SeriesStartYear'] >= 1492){}
				else{					
						$messageStartDate = "<span style=\"padding-left:20px; position:absolute; float:right; color:red;\">Please enter a valid year. (eg. yyyy)</span>";
						$submitFrom = 1;
					}
			}
			}
//end date		
  	if (!empty($_POST['SeriesEndYear'])) {
		if (!ereg("([0-9]{4})",$_POST['SeriesEndYear']) || strlen($_POST['SeriesEndYear'])!==4) {
			$messageEndDate = "<span style=\"padding-left:20px; position:absolute; float:right; color:red;\">Please enter a valid year. (eg. yyyy)</span>";
			$submitFrom = 1;
			}
			else{
				if($_POST['SeriesEndYear'] < 2100 && $_POST['SeriesEndYear'] >= 1492){}
				else{					
						$messageEndDate = "<span style=\"padding-left:20px; position:absolute; float:right; color:red;\">Please enter a valid year. (eg. yyyy)</span>";
						$submitFrom = 1;
					}
				}
				}
//submit form after successful validation-------------------		
		if (isset($_POST['CreateSeries'])&&($submitFrom == 0)){		
		//include ("includes/config.php"); 		

				include 'includes/config.php'; 				
			/*Get all the field values from user input*/
				$seriesId = 0;
				$provid = trim($_POST["selectprov"]);
				$serTitle = $_POST["SeriesTitle"];
				$serDesc = $_POST["SeriesDescription"];
				$serOpenDate = $_POST["SeriesOpenDate"];
				$serDateRange = $_POST["SeriesDateRangeDescription"];
				if ($_POST["SeriesStartYear"] == "") {
					$serStart = NULL;
				} else {
					$serStart = $_POST["SeriesStartYear"];
				}
				if ($_POST["SeriesEndYear"] == "") {
					$serEnd = NULL;
				} else {
					$serEnd = $_POST["SeriesEndYear"];
				}
				$serIdent = $_POST["SeriesIdentifier"];
				$serArr = $_POST["SeriesArrangement"];
				$serExt = $_POST["SeriesExtentDescription"];
				$serRes = $_POST["SeriesRestrictionDescription"];
				$serNote = $_POST["SeriesGeneralNote"];
				
				//check if is submit extra value
				if (isset($_POST['info_input']) && isset($_POST['data_input'])){
				$arraySub = array_combine($_POST["info_input"],$_POST["data_input"]);
				}
				
			/*check if this is a new series for this provenance or if it as already been created*/	
				$seriestitleparam = array(ltrim(rtrim($serTitle)));	
				$tsqlSerCheck = "SELECT SeriesTitle FROM Series WHERE ((ProvenanceId = ".$provid.") AND (SeriesTitle = ?))";
			
				$getData = sqlsrv_prepare( $conn, $tsqlSerCheck, $seriestitleparam);
				if( $getData === false ) {
					 echo "Error in preparing statement.<br/><br/><br/><br/>\n";
					 die;
				}

				if( sqlsrv_execute( $getData))
				{   
				/*echo "Statement executed.\n";*/
				}
				else
				{
					 echo "Error in executing statement.<br/><br/><br/><br/>\n";
					 die;
				}
				$rowCount = 0;
				while (sqlsrv_fetch( $getData ))
				{	
					$rowCount++;
				}
				
			if ($rowCount > 0) {
				echo "This series was already created for this provenance.";
				die;
			};
				
			/*Call the stored procedure that inserts data into the Series table*/
					$tsql_callSP = "{call pac_CreateSeries( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}"; 
					$params = array(   
								 array($serTitle, SQLSRV_PARAM_IN),
								 array($serDesc, SQLSRV_PARAM_IN),  
								 array($serOpenDate, SQLSRV_PARAM_IN),  
								 array($serStart, SQLSRV_PARAM_IN),  
								 array($serEnd, SQLSRV_PARAM_IN),  
								 array($serDateRange, SQLSRV_PARAM_IN),  
								 array($serExt, SQLSRV_PARAM_IN),  
								 array($serArr, SQLSRV_PARAM_IN),  
								 array($serRes, SQLSRV_PARAM_IN),  		
								 array($serNote, SQLSRV_PARAM_IN),  
								 array($serIdent, SQLSRV_PARAM_IN),   
								 array($provid, SQLSRV_PARAM_IN),
								 array($seriesId, SQLSRV_PARAM_OUT)
							   );  
							   					
					$stmt = sqlsrv_query($conn, $tsql_callSP, $params);
//SQL validation 1

				if(!$stmt && $seriesId == 0){
					$SQLmessageError = "Series was not added to database due to an error.";			
					$SQLErrorDB = print_r(sqlsrv_errors(),true);					
					}
				else{			
					if (!empty($_POST['Keyword_input'])) {
						$arrKey = $_POST["Keyword_input"];	
					
					foreach($arrKey as $val){
						$tsql_callSP = "{call PAC_CreateSeriesKeyword( ?, ?)}"; 
						$params = array(   
								 array($seriesId, SQLSRV_PARAM_IN),
								 array(trim($val), SQLSRV_PARAM_IN)
							   );  			   
						$stmt = sqlsrv_query( $conn, $tsql_callSP, $params);
						//validate SQL execute for each Series Keyword catch error
						if (!$stmt){
							$SQLmessageError = "Series Keyword was not added to database due to an error.";
							$SQLErrorDB = print_r(sqlsrv_errors(),true);
							$SQLErrorDBcheck = 1;
							sqlsrv_close( $conn);
							break;
						}		
						}
					}
				// 2
				if (!isset($SQLErrorDBcheck)){				
					
			/*Call the stored procedure that inserts data into the SeriesLocation table*/
			if (!empty($_POST['Location_input'])) {
				$arrLoc = $_POST["Location_input"];	
				foreach($arrLoc as $valL){
					$tsql_callSP = "{call PAC_CreateSeriesLocation( ?, ?)}"; 
					$params = array(   
							 array($seriesId, SQLSRV_PARAM_IN),
							 array(trim($valL), SQLSRV_PARAM_IN)
						   );  			   
					$stmt = sqlsrv_query( $conn, $tsql_callSP, $params);
					//validate SQL execute for each Series location catch error
					if (!$stmt){
						$SQLmessageError = "Series Create Location did not succeed.";
						$SQLErrorDB = print_r(sqlsrv_errors(),true);
						$SQLErrorDBcheck = 1;
						sqlsrv_close( $conn);
					break;
					}
				}
				}
				// 4
				if (!isset($SQLErrorDBcheck)){
					
				
				$tsql_callSP = "{call PAC_CreateSeriesSubject( ?, ?, ?)}"; 
					//add values if not empty
					if (!empty($arraySub)){
					foreach($arraySub as $key=>$value) {			
								$params = array(   
									 array($seriesId, SQLSRV_PARAM_IN),
									 array($key, SQLSRV_PARAM_IN),  
									 array($value, SQLSRV_PARAM_IN) 
								   ); 
			
									$stmt = sqlsrv_query( $conn, $tsql_callSP, $params);
									//validate SQL execute for each Series Subject catch error
									if (!$stmt){
										$SQLmessageError = "Series Create Subject did not succeed.";
										$SQLErrorDB = print_r(sqlsrv_errors(),true);
										$SQLErrorDBcheck = 1;
										sqlsrv_close( $conn);
										break;
									}									
							}	
					}
					
			/*Close out the connections*/	
			sqlsrv_close( $conn);
			include("includes/serNewSuccess.php");
			exit;
				
				//end 4
					}
				//end 2
					}	
				//end 1
					}
				
		}
//submit form after successful validation
}

///////////////------------------------------------------------------------------------
include 'includes/config.php'; 
$term = urldecode(@$_GET["prov"]); 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Persistent Digital Archives and Library System" />
<title>PeDALS Web Administration</title>
<link rel="shortcut icon" href="images/favicon.ico" />
<link href="includes/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="includes/showdesc.js"></script>
</head>
<body>
<?php include 'includes\header.php'; ?>
<script language="javascript">
/*April 1 2009
Function add Element create on-the-fly new DIV switch holds everything that we want to put on our website
Function remove element delete one element from our div
*/
var nextNumber = 0;

function addElement() {
  nextNumber += 1;  
  var newDiv = document.createElement('div');
  var divId = 'input'+nextNumber+'Div';
  newDiv.setAttribute('id',divId);
  newDiv.innerHTML = '<tr><td style=\"padding: 5px;\"><input type=\"text\" name=\"info_input[]\" maxlength=\"25\" size=\"17\"></td><td style=\"padding: 5px;\"><input type=\"text\" name=\"data_input[]\" maxlength=\"100\" size=\"45\"></td><td><a href=\"javascript:;\" onclick=\"removeElement(\''+divId+'\');\" style=\"text-decoration: none;\">&nbsp;<img border=\"0\" src=\"images/delete.png\"/></a></td></tr>'; 
  document.getElementById('contentDiv').appendChild(newDiv);
}
function removeElement(divNum) {
    document.getElementById('contentDiv').removeChild(document.getElementById(divNum));
}
var nextNumberKeyword = 0;
function addElementKeyword() {
  nextNumberKeyword += 1;  
  var newDivKeyword = document.createElement('div');
  var divIdKeyword = 'input'+nextNumberKeyword+'Div';
  newDivKeyword.setAttribute('id',divIdKeyword);
  newDivKeyword.innerHTML = '<tr><td style=\"padding: 5px;\"><input type=\"text\" name=\"Keyword_input[]\" maxlength=\"50\" size=\"70\"></td><td><a href=\"javascript:;\" onclick=\"removeElementKeyword(\''+divIdKeyword+'\');\" style=\"text-decoration: none;\">&nbsp;<img border=\"0\" src=\"images/delete.png\"/></a></td></tr>'; 
  document.getElementById('contentDivKeyword').appendChild(newDivKeyword);
}
function removeElementKeyword(divNumKeyword) {
    document.getElementById('contentDivKeyword').removeChild(document.getElementById(divNumKeyword));
}

var nextNumberLocation = 0;
function addElementLocation() {
  nextNumberLocation += 1;  
  var newDivLocation = document.createElement('div');
  var divIdLocation = 'input'+nextNumberLocation+'Div';
  newDivLocation.setAttribute('id',divIdLocation);
  newDivLocation.innerHTML = '<tr><td style=\"padding: 5px;\"><input type=\"text\" name=\"Location_input[]\" maxlength=\"250\" size=\"70\"></td><td><a href=\"javascript:;\" onclick=\"removeElementLocation(\''+divIdLocation+'\');\" style=\"text-decoration: none;\">&nbsp;<img border=\"0\" src=\"images/delete.png\"/></a></td></tr>'; 
  document.getElementById('contentDivLocation').appendChild(newDivLocation);
}
function removeElementLocation(divNumLocation) {
    document.getElementById('contentDivLocation').removeChild(document.getElementById(divNumLocation));
}
</script>
<div id="breadcrumb-container">
  <div id="breadcrumb"><a href="index.php" title="Home page">Home</a> / <a href="serSummary.php" title="Series">Series</a> / Add Series</div>
  <div id="breadcrumb-side"><form name="search" action="search.php"><input type="text" name="q" width="50"/><input type="submit" value="Go" /></form><a href="advSearch.php" title="Advanced Search" alt="Advanced Search">Advanced Search</a>
  </div>
  <div class="clear"></div>
</div>
<!-- 

  CONTENT

  -->
<div id="content-container">
  <!-- 
	
	SIDE COLUMN
	
	-->
  <div id="content-side">
    <ul class="link-list-vertical">
      <li><a href="serSummary.php" title="View a list of all series in PeDALS.">List Series</a></li>
      <li><a href="serNew.php" title="Add a new series to PeDALS.">Add Series</a></li>
    </ul>
  </div>
  <!-- 
	
	MAIN COLUMN
	
	-->
  <div id="content"><a name="maincontent" id="maincontent"></a>
    <h1>Add Series</h1>
    
<?php 
//Error Message Box
if(isset($SQLErrorDB) && isset($SQLmessageError)){
$errorDiv = <<<__HTML_END
    <div style="padding-right:20px; font-size:16px; color:#F00;">$SQLmessageError
    <div style="cursor:pointer; color:#900; font-size: 12px;" onclick="if(document.getElementById('sqlServerErrorMessage').style.display == 'none')document.getElementById('sqlServerErrorMessage').style.display = ''; else document.getElementById('sqlServerErrorMessage').style.display = 'none';">Show error details</div>    
    <div id="sqlServerErrorMessage" style="background-color:#FFFFFF; color:#000; font-family:'Courier New', Courier, monospace; font-size:12px; border:1px solid #F00; width:100%; display:none; padding:7px;">$SQLErrorDB</div>    
    </div>
__HTML_END;
echo $errorDiv;
}
//change Provenance SELECT method to display
$ProvenanceSelect = "<select name=\"selectprov\">";
	$tsql = "{call PAC_GetProvenances}";

	/* Create the statement. */
	$getData = sqlsrv_prepare( $conn, $tsql);
	if( $getData === false ) {
		 echo "Error in preparing statement.\n";
		 die( print_r( sqlsrv_errors(), true));
	}
	/* Execute the statement. Display any errors that occur. */
	if( sqlsrv_execute( $getData))
	{   
	/*echo "Statement executed.\n";*/
	}
	else
	{
		 echo "Error in executing statement.\n";
		 die( print_r( sqlsrv_errors(), true));
	}

	$rowCount = 0;
	$ProvenanceSelect .= "<option selected ></option>";
	while (sqlsrv_fetch( $getData ))
	{
		//change for call new series from Provenance page
		$id = sqlsrv_get_field($getData, 0);
		$name = sqlsrv_get_field($getData, 1);		
		$ProvenanceSelect .= "<option ";
		if (isset($_POST['selectprov']) && $_POST['selectprov'] == $id){
			$ProvenanceSelect .= "selected value='".$id."'>";			
			}
		elseif (isset($_GET['prov']) && $_GET['prov'] == $id){
			$ProvenanceSelect .= "selected value='".$id."'>";
			}
		else {
				$ProvenanceSelect .= "value='".$id."'>";
				}	
		$ProvenanceSelect .= $name."</option>";

		$rowCount++;
    }	
$ProvenanceSelect .="</select>";
//end change for call new series from Provenance page
?>

	<?php
	if( $rowCount == 0) { 
	    echo "There are no provenances set up yet.  Please <a href=\"provNew.php\">add a provenance</a>."; 
		include 'includes\footer.php';
		exit;
	}	
    sqlsrv_free_stmt( $getData );	
	sqlsrv_close( $conn); 
	?>
</p>
<!--- Includes for Core Standards --->
<div id="div201" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\201.html'; ?></div>

<div id="div202.1" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\202.1.html'; ?></div>

<div id="div202.2" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\202.2.html'; ?></div>

<div id="div202.3" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\202.3.html'; ?></div>

<div id="div203" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\203.html'; ?></div>

<div id="div204" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\204.html'; ?></div>

<div id="div205" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\205.html'; ?></div>

<div id="div206" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\206.html'; ?></div>

<div id="div207" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\207.html'; ?></div>

<div id="div207.1" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\207.1.html'; ?></div>

<div id="div207.2" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\207.2.html'; ?></div>

<div id="div208" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\208.html'; ?></div>

<div id="div208.1" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\208.1.html'; ?></div>

<div id="div208.2" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\208.2.html'; ?></div>

<div id="div209" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\209.html'; ?></div>

<div id="div210" style="display: none; border:solid thin black; position:fixed; background-color:#fff; width:500px; margin-top:15px;"><?php include 'CoreData\210.html'; ?></div>

<form method="POST"> 
<p><strong>Provenance (mandatory)</strong>
<?php //final display SELECT for Provenance or Error message
if (isset($messageProvenance)) echo $messageProvenance;
echo "<br/>";
	echo $ProvenanceSelect;
?>
<p><strong>Series Title (mandatory)</strong> (<a onclick="showhide('div201');" class="desclink">201</a>)
<?php if (isset($messageSeries))echo $messageSeries;?>
<br/><input type="text" name="SeriesTitle" size="90" maxlength="250" value="<?php if (isset($_POST['SeriesTitle']))echo $_POST['SeriesTitle'];?>"></p>    
<p><strong>Identifier:</strong><br/><input type="text" name="SeriesIdentifier" size="90" maxlength="50" value="<?php if (isset($_POST['SeriesIdentifier']))echo $_POST['SeriesIdentifier'];?>"></p> 
<p><strong>Date Range</strong> (<a onclick="showhide('div202.1');" class="desclink">202.1</a>)<br/><input type="text" name="SeriesDateRangeDescription" size="90" maxlength="255" value="<?php if (isset($_POST['SeriesDateRangeDescription']))echo $_POST['SeriesDateRangeDescription'];?>"></p>
<p><strong>Start Year (YYYY)</strong> (<a onclick="showhide('div202.2');" class="desclink">202.2</a>)
<?php if (isset($messageStartDate))echo $messageStartDate;?>
<br/><input type="text" name="SeriesStartYear" size="5" maxlength="4"  value="<?php if (isset($_POST['SeriesStartYear']))echo $_POST['SeriesStartYear'];?>"></p>

<p><strong>End Year (YYYY)</strong> (<a onclick="showhide('div202.3');" class="desclink">202.3</a>)
<?php if (isset($messageEndDate))echo $messageEndDate;?>
<br/><input type="text" name="SeriesEndYear" size="5" maxlength="4"  value="<?php if (isset($_POST['SeriesEndYear']))echo $_POST['SeriesEndYear'];?>"></p>
<p><strong>Extent Description</strong> (<a onclick="showhide('div203');" class="desclink">203</a>)<br/><textarea name="SeriesExtentDescription" rows="3" cols="68" maxlength="1024"><?php if (isset($_POST['SeriesExtentDescription']))echo $_POST['SeriesExtentDescription'];?></textarea></p>   

<p><strong>Arrangement</strong> (<a onclick="showhide('div204');" class="desclink">204</a>)<br/><textarea name="SeriesArrangement" rows="3" cols="68" maxlength="1024"><?php if (isset($_POST['SeriesArrangement']))echo $_POST['SeriesArrangement'];?></textarea></p> 

<p><strong>Description</strong> (<a onclick="showhide('div205');" class="desclink">205</a>)
<br/><textarea name="SeriesDescription" rows="8" cols="68"><?php if (isset($_POST['SeriesDescription']))echo $_POST['SeriesDescription'];?></textarea></p> 

<p><strong>General Note</strong> (<a onclick="showhide('div206');" class="desclink">206</a>)<br/>
<textarea name="SeriesGeneralNote" rows="3" cols="68"><?php if (isset($_POST['SeriesGeneralNote']))echo $_POST['SeriesGeneralNote'];?></textarea></p>      
<p><strong>Open Date (MM/DD/YYYY)</strong> (<a onclick="showhide('div207');" class="desclink">207</a>) (<a onclick="showhide('div207.2');" class="desclink">207.2</a>)
<?php if (isset($messageOpenDate))echo $messageOpenDate;?>
<br/><input type="text" name="SeriesOpenDate" size="10" maxlength="10" value="<?php if (isset($_POST['SeriesOpenDate']))echo $_POST['SeriesOpenDate'];?>"></p>
<p><strong>Restriction Description</strong> (<a onclick="showhide('div207.1');" class="desclink">207.1</a>)<br/><input type="text" name="SeriesRestrictionDescription" size="90" maxlength="1024" value="<?php if (isset($_POST['SeriesRestrictionDescription']))echo $_POST['SeriesRestrictionDescription'];?>"></p>      
<p><strong>Geographic Locations</strong> (<a onclick="showhide('div209');" class="desclink">209</a>)<br/>
<a href="javascript: addElementLocation();" style="text-decoration: none; vertical-align: text-middle;"><img border="0" src="images/add.png"/>Add Location</a>
<div id="contentDivLocation"></div></p> <br/> 
<p><strong>Keywords</strong> (<a onclick="showhide('div210');" class="desclink">210</a>)<br/>
<a href="javascript: addElementKeyword();" style="text-decoration: none; vertical-align: text-middle;"><img border="0" src="images/add.png"/>Add Keyword</a>
<div id="contentDivKeyword"></div></p> 
<br/>
<p><strong>Subjects</strong> (<a onclick="showhide('div208');" class="desclink">208</a>)
        <table class="table" border="1" cellspacing="0" summary="Table listing">
      <thead>
        <tr>
          <th scope="col">Subject Qualifier (<a onclick="showhide('div208.1');" class="desclink">208.1</a>)</th>
          <th scope="col">Subject Heading (<a onclick="showhide('div208.2');" class="desclink">208.2</a>)</th>
        </tr>
      </thead>
      <tbody>
      		<tr><td colspan="2"><a href="javascript: addElement();" style="text-decoration: none; vertical-align: text-middle;"><img border="0" src="images/add.png"/>Add Subject</a>
			<div id="contentDiv"></div></td></tr>
	</tbody>
	</table>
</p><br/>
	  <input type="submit" value="submit" name="CreateSeries"><br />
      <input type="hidden" name="_submit_check" value="1"/> 
</form>
<!--Perform the following if user clicks on the submit button-->
<?php
if (array_key_exists('_submit_check', $_POST)) {

}

?>
<?php include 'includes\footer.php'; ?>
</div>
</body>
</html>
